package com.aisile.user.controller.v1;

import com.aisile.apis.user.ApUserIdentityControllerApi;
import com.aisile.model.common.dtos.ResponseResult;
import com.aisile.model.user.dtos.AuthDto;
import com.aisile.user.service.ApUserIdentityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Auther:yry
 * @Date:2024/1/3 0003
 * @VERSON:1.0
 */
@RestController
@RequestMapping("/api/v1/identity")
public class ApUserIdentityController implements ApUserIdentityControllerApi {

    @Autowired
    private ApUserIdentityService apUserIdentityService;

    @PostMapping("/pass")
    @Override
    public ResponseResult authPass(@RequestBody AuthDto dto) {
        return apUserIdentityService.updateStatusById(dto,(short)9);
    }

    @PostMapping("/fail")
    @Override
    public ResponseResult authFail(@RequestBody AuthDto dto) {
        return apUserIdentityService.updateStatusById(dto,(short)2);
    }
}
